package com.example.shop_car_2208.db

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.example.shop_car_2208.entity.SearchEntity

@Dao
interface SearchDao {
    //新增历史记录
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertSearch(searchEntity: SearchEntity)
    //按时间顺序排序---desc 倒序 ase --- 正序
    @Query("select * from search_history order by time")
    fun querySearch():List<SearchEntity>
}